/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Nihongo
 * Copyright (C) Massimiliano Maniscalco 2011, 2012 <massimiliano@massiLinuxBook>
 * 
Nihongo is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Nihongo is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _TESTINSERIMENTONUMERI_H_
#define _TESTINSERIMENTONUMERI_H_

#include "test_inserimento.h"

#define CIFRE_HIRAGANA		0
#define MODO_NUMERI_CARD	0
#define MODO_NUMERI_QUAN	1
#define MODO_CALENDARIO		2

class TestInserimentoNumeri: public TestInserimento 
{
public:
	typedef pair < Glib::ustring, Glib::ustring > Numero;
	inline TestInserimentoNumeri ( Glib::RefPtr<Gtk::Builder> _bldr );
	inline ~TestInserimentoNumeri ();
	void run_test ( char *options );

protected:
	void update_window ( void );
	void on_risposta ( char tasto = -1 );
	void next_question ( void );
	bool show_result ( void );
	void preparaSelezioneNumeri ( char nmrd, char nmax );
	void numeroInHiragana ( Glib::ustring &hira, int val );

private:
	list<Numero> *_contenuto;
	list<Numero>::iterator _numeroCorrente;

};

inline TestInserimentoNumeri::
TestInserimentoNumeri ( Glib::RefPtr<Gtk::Builder> _bldr )
: _contenuto ( new list<Numero> ), _numeroCorrente ( _contenuto->begin() )
{
	init_test_inserimento ( _bldr );
	connect_signals ();
}

inline TestInserimentoNumeri::
~TestInserimentoNumeri ()
{
	delete _contenuto;
}

#endif // _TESTINSERIMENTONUMERI_H_
